#ifndef MENUITEM_H
#define MENUITEM_H

#include <QtCore>
#include <QtGui>

class MenuItem : public QGraphicsWidget
{
    Q_OBJECT
public:
    MenuItem(const QString &text, const QPixmap & pixmap, QGraphicsItem *parent = 0);
    QRectF boundingRect() const;
private:
    QString m_text;
    QPixmap m_pixmap;
    bool m_hovered;
protected:
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
    void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
signals:
    void pressed();
    void rightClicked();
};

#endif // MENUITEM_H
